package com.amoyt.project.controller.admin;

import com.amoyt.project.domain.res.Result;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Date: 2025/8/11
 * @Time: 11:32
 * @Author: TQ_QT
 * @Description:
 */
@RestController
@Tag(name = "测试接口")
@RequestMapping("admin")
public class TestController {

    @GetMapping("test")
    //权限
    //@PreAuthorize("hasAuthority('system:aa:bb')")
    //角色呢 hasRole('super_admin') 会自动拼接 ROLE_ 前缀，实际验证的是 ROLE_super_admin
    @PreAuthorize("hasRole('super_admin')")
    public Result test(){
        return Result.success("测试成功");
    }
}
